package br.gov.mi.corporativo.dominio.boundary.rhmi.situacaofuncional;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;

import br.gov.mi.corporativo.dominio.entidade.rhmi.SituacaoFuncional;


@Path("situacaofuncional")
public class SituacaoFuncionalRestAdapter extends SpringBeanAutowiringSupport {


	@Autowired
	private SituacaoFuncionalEndPoint service;
	
	
	@GET
	@Produces({MediaType.APPLICATION_JSON})
	public Iterable<SituacaoFuncional> recuperarTodos(){
		return service.recuperarTodos();
		
	}
	
	
	@GET
	@Path("/id/{id}")
	@Produces({MediaType.APPLICATION_JSON})
	public SituacaoFuncional recuperarPorId(@PathParam("id")Long id){
		return service.recuperarPorId(id);
		
	}
	
	
	@GET
	@Path("/descricao/{descricao}")
	@Produces({MediaType.APPLICATION_JSON})
	public SituacaoFuncional recuperarPorNome(@PathParam("descricao")String descricao){
		return service.recuperarPorDescricao(descricao);
		
	}
	
	
}
